<template>
  <div>
    <!-- 全屏插件使用
       screenfull
       使用：
         1：下载  npm i screenfull
         2:导入  import screenfull  from 'screenfull'
         3:使用
             screenfull.toggle()  全屏与非全屏切换
             screenfull.isEnabled 当前环境是否支持全屏

     -->
    <el-button @click="fullClick">全屏</el-button>
  </div>
</template>
<script>
import screenfull from 'screenfull'
export default {
  methods: {
    fullClick() {
      if (screenfull.isEnabled) {
        console.log(screenfull)
        screenfull.toggle()
      } else {
        this.$message.error('暂不支持全屏')
      }
    }
  }
}
</script>
<style>
</style>
